package com.gxuwz.medical.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import com.gxuwz.medical.domain.chronicdis.Chronicdis;
import com.gxuwz.medical.domain.chronicinfo.ChronicInfo;
import com.gxuwz.medical.domain.chronicinfo.Reducttreat;
import com.gxuwz.medical.domain.person.Person;
import com.gxuwz.medical.domain.policy.Policy;
import com.gxuwz.medical.exception.PersonNotFoundException;

public class ReducttreatDao extends GenericDao<Reducttreat>{
	@Override
	protected Reducttreat handle(ResultSet rs) throws SQLException {
		
		Reducttreat entity=new Reducttreat();
		entity.setChronicInfoId(rs.getString("chronicInfoId"));
		entity.setId(rs.getInt("id"));
		entity.setHosId(rs.getString("hosId"));
		entity.setMoney(rs.getInt("money"));
		entity.setFreemoney(rs.getInt("freemoney"));
		entity.setReductstatus(rs.getInt("reductstatus"));
		entity.setTreattime(rs.getString("treattime"));
		ChronicInfoDao dao=new ChronicInfoDao();
		Object[] params=new Object[1];
		params[0]=entity.getChronicInfoId();
		List<ChronicInfo> list=dao.queryOjects("select * from t_chronicInfo where id=?", params);
		entity.setChronicInfo(list.get(0));
		
		return entity;
		
	}
}
